package cn.imvc.app.entities;

/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="son")
public class Son implements Serializable {
	public Son() {
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="SON_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="SON_ID_GENERATOR", strategy="native")	
	private int id;
	
	@Column(name="name", nullable=true, length=20)	
	private String name;
	
	@ManyToOne(targetEntity=Father.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="parentId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	private Father parent;
	
	private void setId(int value) {
		this.id = value;
	}
	
	public int getId() {
		return id;
	}
	
	public int getORMID() {
		return getId();
	}
	
	public void setName(String value) {
		this.name = value;
	}
	
	public String getName() {
		return name;
	}
	
	public void setParent(Father value) {
		this.parent = value;
	}
	
	public Father getParent() {
		return parent;
	}
	
	public String toString() {
		return String.valueOf(getId());
	}
	
}
